<template>
  <base-page-view class-name="page-container" :show-to-top="false">
    <view class="box">
      <view class="top">
        <view class="logo_vision">
          <b-image v-if="plaformType==='bx'" src="/static/images/login/login_logo.png" width="288" height="259"></b-image>
          <template v-else-if="plaformType==='bxzb'">
            <b-image class-name="logo" src="/static/images/login/logo_bxzb.png" width="150" height="150" mode="aspectFit"></b-image>
            <view class="o-p">轻创业直播工具</view>
          </template>
          <!-- <view class="o-p">品牌社交电商</view> -->
          <view v-if="vis" class="o-small">{{ vis }}</view>
        </view>
      </view>
      <view class="about">
        <view class="sLine">
          <view class="lCont">
            <text>官方微信</text>
          </view>
          <view class="rCont" @click="handleCopy(textObj[plaformType].wechat, $event)">
            <text>{{ textObj[plaformType].wechat }}</text>
          </view>
        </view>
        <view class="sLine">
          <view class="lCont">
            <text>官方微博</text>
          </view>
          <view class="rCont" @click="handleCopy(textObj[plaformType].weibo, $event)">
            <view class="has-icon">
              <text>{{ textObj[plaformType].weibo }}</text>
              <image class="weibo" src="/static/images/icon/weibo_v.png" />
            </view>
          </view>
        </view>
        <view class="sLine">
          <view class="lCont">
            <text>官方网站</text>
          </view>
          <view class="rCont" @click="handleCopy('www.bisinuolan.com', $event)">
            <text>www.bisinuolan.com</text>
          </view>
        </view>
        <view class="sLine" @click="ruleJump('intro')">
          <view class="lCont">
            <text>{{ textObj[plaformType].info }}</text>
          </view>
          <view class="rCont">
            <image src="/static/images/icon/icon_arror_right_grey.png" />
          </view>
        </view>
        <view class="sLine" @click="ruleJump('serviceContract')">
          <view class="lCont">
            <text>服务协议</text>
          </view>
          <view class="rCont">
            <image src="/static/images/icon/icon_arror_right_grey.png" />
          </view>
        </view>
        <view class="sLine" @click="ruleJump('privateAgreement')">
          <view class="lCont">
            <text>隐私政策</text>
          </view>
          <view class="rCont">
            <image src="/static/images/icon/icon_arror_right_grey.png" />
          </view>
        </view>
        <view v-if="plaformType==='bx'" class="sLine" @click="ruleJump('certificates')">
          <view class="lCont">
            <text>平台证照</text>
          </view>
          <view class="rCont">
            <image src="/static/images/icon/icon_arror_right_grey.png" />
          </view>
        </view>
      </view>
    </view>
  </base-page-view>
</template>

<script>
import { setClipboardData } from '@/utils/tools'
import './index.scss'
export default {
  data() {
    return {
      vis: '',
      plaformType: 'bx',
      textObj: {
        bx: {
          wechat: 'BIXUAN',
          weibo: '碧选官方微博',
          info: '碧选简介'
        },
        bxzb: {
          wechat: 'BIXUANZHIBO',
          weibo: '碧选直播官方微博',
          info: '碧选直播简介'
        }
      }
    }
  },
  onLoad(option) {
    this.plaformType = option.type || 'bx'
    if (option.version) {
      this.vis = option.version
    }
  },
  methods: {
    handleCopy(target, event) {
      setClipboardData({
        data: target
      })
    },
    ruleJump(type) {
      let url = ''
      const params = this.plaformType !== 'bx' ? `&plaform=${this.plaformType}` : ''
      switch (type) {
        case 'intro':
          url = '/pagesMine/rule/index?type=intro'
          break
        case 'serviceContract':
          url = '/pagesMine/rule/index?type=serviceContract'
          break
        case 'privateAgreement':
          url = '/pagesMine/rule/index?type=privateAgreement'
          break
        case 'certificates':
          url = '/pagesMine/rule/index?type=certificates'
          break
        default:
          url = '/'
          break
      }
      if (url.length > 1) {
        url += params
      }
      this.$navigateTo(url)
    }
  }
}
</script>
